class CreateDocuments < ActiveRecord::Migration
  def change
    create_table :documents do |t|
      t.string  :title
      t.text    :body
      t.integer :rating, :default => 0
      t.boolean :comments_allowed, :default => true

      # TODO set document_type, document_id columns NOT NULL?
      t.references :source, :polymorphic => true
      t.references :user

      t.timestamps
    end
  end
end
